package com.grf.pojo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

@Data
@Document(collection = "user")
//@CompoundIndex(def = "{'id':1,'userName':-1}")复合索引
public class User {

    @Id
    //@Indexed 索引
    private String id;
    private String userName;

}
